//
//  TimeSpaceDirectionPage.m
//  Portable Traffic Signal Assistor
//
//  Created by Ding on 9/6/12.
//  Copyright (c) 2012 TTU. All rights reserved.
//

#import "TimeSpaceDirectionPage.h"

@interface TimeSpaceDirectionPage ()

@end

@implementation TimeSpaceDirectionPage
@synthesize Northsouthbutton;
@synthesize Eastwestbutton;
@synthesize signal=_signal;
@synthesize agency=_agency;
@synthesize subSystem=_subSystem;
@synthesize timingPattern=_timingPattern;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil agency:(Agency *)agency subsystem:(SubSystem *)subsystem timingPattern:(TimingPattern *)timingPattern signal:(Signal *)signal
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        self.agency=agency;
        self.subSystem=subsystem;
        self.timingPattern=timingPattern;
        self.signal=signal;
    }
    return self;
    
}



- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [self setNorthsouthbutton:nil];
    [self setEastwestbutton:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (void)dealloc {
    [Northsouthbutton release];
    [Eastwestbutton release];
    [_signal release];
    [_agency release];
    [_subSystem release];
    [_timingPattern release];
    [super dealloc];
}
- (IBAction)ClickNorthsouthbutton:(id)sender {
    TimeSpaceViewController *timeSpaceViewController=[[[TimeSpaceViewController alloc] initWithNibName:@"TimeSpaceViewController" bundle:nil agency:self.agency subsystem:self.subSystem timingPattern:self.timingPattern signal:self.signal direction:SOUTHBOUND] autorelease];
    [timeSpaceViewController setTitle:@"Time Space View"];
    UINavigationController * parentController=self.navigationController;
    [parentController pushViewController:timeSpaceViewController animated:YES];
}
- (IBAction)ClickNorthButton:(id)sender {
    TimeSpaceViewController *timeSpaceViewController=[[[TimeSpaceViewController alloc] initWithNibName:@"TimeSpaceViewController" bundle:nil agency:self.agency subsystem:self.subSystem timingPattern:self.timingPattern signal:self.signal direction:NORTHBOUND] autorelease];
    [timeSpaceViewController setTitle:@"Time Space View"];
    UINavigationController * parentController=self.navigationController;
    [parentController pushViewController:timeSpaceViewController animated:YES];
}
- (IBAction)ClickSouthButton:(id)sender {
    TimeSpaceViewController *timeSpaceViewController=[[[TimeSpaceViewController alloc] initWithNibName:@"TimeSpaceViewController" bundle:nil agency:self.agency subsystem:self.subSystem timingPattern:self.timingPattern signal:self.signal direction:SOUTHBOUND] autorelease];
    [timeSpaceViewController setTitle:@"Time Space View"];
    UINavigationController * parentController=self.navigationController;
    [parentController pushViewController:timeSpaceViewController animated:YES];
}
- (IBAction)ClickEastButton:(id)sender {
    TimeSpaceViewController *timeSpaceViewController=[[[TimeSpaceViewController alloc] initWithNibName:@"TimeSpaceViewController" bundle:nil agency:self.agency subsystem:self.subSystem timingPattern:self.timingPattern signal:self.signal direction:EASTBOUND] autorelease];
    [timeSpaceViewController setTitle:@"Time Space View"];
    UINavigationController * parentController=self.navigationController;
    [parentController pushViewController:timeSpaceViewController animated:YES];
}
- (IBAction)ClickWestButton:(id)sender {
    TimeSpaceViewController *timeSpaceViewController=[[[TimeSpaceViewController alloc] initWithNibName:@"TimeSpaceViewController" bundle:nil agency:self.agency subsystem:self.subSystem timingPattern:self.timingPattern signal:self.signal direction:WESTBOUND] autorelease];
    [timeSpaceViewController setTitle:@"Time Space View"];
    UINavigationController * parentController=self.navigationController;
    [parentController pushViewController:timeSpaceViewController animated:YES];
}

- (IBAction)ClickEastwestbutton:(id)sender {
}
@end
